import Vue from 'vue'
import App from './App'
import store from './store'
import uView from "uview-ui"
import http from './common/httpRequest'
import mHelper from '@/utils/helper.js';

import $mGraceChecker from '@/utils/graceChecker';
import $mFormRule from '@/utils/formRule.config.js';


Vue.use(uView);
Vue.config.productionTip = false

//表单验证

import check from 'common/check/index.js'
Vue.prototype.$store = store;
Vue.prototype.$http = http
Vue.prototype.check = check
Vue.prototype.$mHelper = mHelper;

Vue.prototype.$mGraceChecker = $mGraceChecker;
Vue.prototype.$mFormRule = $mFormRule;
App.mpType = 'app'
Vue.prototype.$api = store.state.baseUrl
// Vue.prototype.$api = 'http://180.76.58.164:7111'
// Vue.prototype.$api = 'http://47.92.134.187:9984'
// Vue.prototype.$api = 'http://admin.chaoshiren.com.cn/prod-api

//全局挂载
Vue.mixin({
	computed: {
		token: {
			get() {
				return store.getters.token;
			},
			set(val) {
				store.state.token = val;
			}
		},

	}
});
const tipMsg = () => {
	Vue.prototype.$http.get('app/UserController/selectUserMassges').then(res => {
		if (res.code == 200) {
			store.state.userinfo = res.data;
			// store.commit('saveInfo',res.data)
		}
		uni.hideLoading();
	})
}
Vue.prototype.$uniApi = {
	tipMsg
};
const app = new Vue({
	...App
})

let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)

app.$mount()
